Skip to content

Conversation

@allenporter
Copy link
Contributor

@allenporter allenporter commented Dec 3, 2025

Adds tests for the desired output, then update the algorithm to make the tests path (AI assisted).

This needs additional support because (1) the naming of variables for device features are more complex than other fields and (2) the typing of a dict of boolean fields is unique to DeviceFeatures.

This adds a few variations of tests for different forms of coverage from:

  • Device features itself
  • Test objects with similar behaviors
  • Camelize/decamelize functions themselves

Required to fix home-assistant/core#157663

… properly.

Adds tests for the desired output.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes serialization and deserialization issues in the DeviceFeatures class by improving the naming convention handling for complex variable names. The fix addresses two specific challenges: (1) the complex naming patterns used in device feature variables (e.g., handling numbers and acronyms like "CES2022"), and (2) the unique typing of boolean field dictionaries in DeviceFeatures.

Key changes:

  • Enhanced _decamelize function to properly handle numbers and acronyms in variable names
  • Renamed is_ces2022_supported to is_ces_2022_supported for consistent naming
  • Added comprehensive test coverage for serialization/deserialization of device features and similar structures

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_supported_features.py Adds serialization/deserialization test for DeviceFeatures
tests/test_containers.py Adds test for boolean features serialization and parametrized tests for camelize/decamelize functions
roborock/device_features.py Renames field from is_ces2022_supported to is_ces_2022_supported
roborock/data/containers.py Updates _decamelize function with improved regex patterns and adds class type checking
SUPPORTED_FEATURES.md Updates documentation to reflect renamed field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@allenporter allenporter merged commit 88b2055 into Python-roborock:main Dec 3, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roborock is not available after update to core-2025.12.0b3

2 participants